package h0707;

import java.util.*;

public class SortByHeightWeight {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //数量
        int n = sc.nextInt();
        sc.nextLine();
        String h = sc.nextLine();
        String w = sc.nextLine();
        int[] heights = Arrays.stream(h.split(" ")).mapToInt(Integer::parseInt).toArray();
        int[] weights = Arrays.stream(w.split(" ")).mapToInt(Integer::parseInt).toArray();
        getResult(n, heights, weights);
        System.out.println();
    }

    private static void getResult(int n, int[] heights, int[] weights) {
        int[][] students = new int[n][3];
        for (int i = 0; i < n; i++) {
            students[i] = new int[]{heights[i], weights[i], i + 1};
        }
        //比较的时候Comparator比较的其实是二维数组中的一维数组，所以可以进行下面的比较。
        Arrays.sort(students, (o1, o2) -> {
            if (o1[0]!=o2[0]){
                return o1[0]-o2[0];
            }else if (o1[1]!=o2[1]){
                return o1[1]-o2[1];
            }else {
                return o1[2]-o2[2];
            }
        });
//        StringBuilder str = new StringBuilder();
//        str.append(" ");
//        for (int[] student : students) {
//            str.append(student[2]+" ");
//        }
//        System.out.println(str.toString().trim());
        StringJoiner joiner=new StringJoiner(" ");
        for (int[] student : students) {
            joiner.add(student[2]+"");
        }
        System.out.println(joiner);
    }
}
